# @Time : 2024-09-27 15:35
# @Author : Fioman 
# @Phone : 13149920693
"""
获取日期管理类
"""
from datetime import datetime


def get_datetime_for_logger_dir():
    """
    获取日志日期目录,其格式为"2024-09-27"
    :return:
    """
    return datetime.now().strftime("%Y-%m-%d")


def get_datetime_with_ms():
    """
    获取时间,带ms,其格式为"2024-09_30 14:23:45.123"
    %f表示六位数的微妙,然后通过切片,将后面的三位去除掉
    :return:
    """
    return datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]


def get_datetime_with_hms():
    """
    获取事件,其格式为2024-09_30 14:23:45,时分秒
    :return:
    """
    return datetime.now().strftime("%Y-%m-%d %H:%M:%S")


if __name__ == '__main__':
    print(f"get_datetime_for_logger_dir: {get_datetime_for_logger_dir()}")
